
(function (window) {

KC.extend({
	each : function(obj, func) {
		if (KC.isArray(obj)) {
			for (var i = 0, len = obj.length; i < len; i++) {
				if (func(i, obj[i]) === false) break;
			}
		} else {
			for (var key in obj) {
				if (obj.hasOwnProperty(key)) {
					if (func(key, obj[key]) === false) break;
				}
			}
		}
	},
	isArray : function(obj) {
		return Object.prototype.toString.call(obj) === '[object Array]';
	},
	inArray : function(el, arr) {
		for (var i = 0, len = arr.length; i < len; i++) {
			if (el === arr[i]) return true;
		};
		return false;
	}
});

})();
